import java.util.Stack;


public class DropOutStack<E> extends Stack<E> {
	private int size = 10;
	
	public DropOutStack(int size) {
		super();
		this.size = size;
	}
	
	@Override
	public E push(E item) {
		if (size == size()) {
			elementData[0] = null;
			for (int i=1;i<size();i++) {
				elementData[i-1] = elementData[i];
			}
			pop();
		}
		return super.push(item);
	}
}